#pragma once

#include "IDataFileReader.h"

#include <fstream>
#include <map>
#include <string>
#include <vector>

class CsvFileReader : public IDataFileReader
{
public:
    CsvFileReader( const std::string& separator, const std::string& inputFilePath );
    ~CsvFileReader( );

    virtual bool ReadRow( );
    virtual std::string GetStringData( const std::string& fieldName );
    virtual double GetDoubleData( const std::string& fieldName );


private:
    void ParseFirstLine();
    bool ReadLine( std::string& line );

private:
    const std::string                    m_separator;
    std::ifstream                        m_csvFile;
    std::map<std::string, unsigned int>  m_nameDataMap;
    std::vector<std::string>             m_datas;
};

